import request from '@/utils/request'

// 查询设备管理列表
export function listDeviceManage(query) {
  return request({
    url: '/device/deviceManage/page',
    method: 'get',
    params: query
  })
}

// 查询设备管理详细
export function getDeviceManage(id) {
  return request({
    url: '/device/deviceManage/info?id='+id,
    method: 'get'
  })
}

// 新增设备管理
export function addDeviceManage(data) {
  return request({
    url: '/device/deviceManage/save',
    method: 'post',
    data: data
  })
}

// 修改设备管理
export function editDeviceManage(data) {
  return request({
    url: '/device/deviceManage/edit',
    method: 'post',
    data: data
  })
}

// 删除设备管理
export function delDeviceManage(id) {
  return request({
    url: '/device/deviceManage/del?id='+id,
    method: 'delete'
  })
}

// 启用设备分组
export function enable(id) {
  return request({
    url: '/device/deviceManage/enable?id='+id,
    method: 'get'
  })
}

// 禁用设备分组
export function disable(id) {
  return request({
    url: '/device/deviceManage/disable?id='+id,
    method: 'get'
  })
}

// 取消设备分组
export function groupDeviceCancel(data) {
  return request({
    url: '/device/deviceManage/groupDeviceCancel',
    method: 'put',
    data: data
  })
}

// 批量取消设备分组
export function groupDeviceCancelAll(data) {
  return request({
    url: '/device/deviceManage/groupDeviceCancelAll',
    method: 'put',
    params: data
  })
}

// 批量选择分组设备
export function groupDeviceSelectAll(data) {
  return request({
    url: '/device/deviceManage/groupDeviceSelectAll',
    method: 'put',
    params: data
  })
}

// 分组设备列表
export function getGroupDeviceList(query) {
  return request({
    url: '/device/deviceManage/getGroupDeviceList',
    method: 'get',
    params: query
  })
}

// 未分组设备列表
export function getNoGroupDeviceList(query) {
  return request({
    url: '/device/deviceManage/getNoGroupDeviceList',
    method: 'get',
    params: query
  })
}

// 首页查询设备线路管理列表
export function deviceLineList(query) {
  return request({
    url: '/device/deviceManage/deviceLineList',
    method: 'get',
    params: query
  })
}
